﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkWeChat.Domain
{
    /// <summary>
    /// 企业永久授权码 实体类
    /// </summary>
    public class PermanentCode
    {
        /// <summary>
        /// 永久授权码
        /// </summary>
        public string permanent_code { get; set; }

        /// <summary>
        /// 授权方信息
        /// </summary>
        public Auth_Corp_Info auth_corp_info { get; set; }

        /// <summary>
        /// 授权信息（包含服务商、授权人）
        /// </summary>
        public Auth_Info auth_info { get; set; }

        public string access_token { get; set; }

        public string expires_in { get; set; }
    }

    /// <summary>
    /// 授权方信息
    /// </summary>
    public class Auth_Corp_Info
    {
        /// <summary>
        /// 授权方的corpid
        /// </summary>
        public string corpid { get; set; }
        /// <summary>
        /// 授权方LOGO
        /// </summary>
        public string corp_round_logo_url { get; set; }
        /// <summary>
        /// 授权方微信二维码
        /// </summary>
        public string corp_wxqrcode { get; set; }
        /// <summary>
        /// 授权方企业全称
        /// </summary>
        public string corp_full_name { get; set; }
    }

    /// <summary>
    /// 授权信息（包含服务商、授权人）
    /// </summary>
    public class Auth_Info
    {
        /// <summary>
        /// 授权人信息
        /// </summary>
        public List<Agent_Info> Agent { get; set; }
    }

    /// <summary>
    /// 授权人信息
    /// </summary>
    public class Agent_Info
    {
        /// <summary>
        /// 服务商的应用id
        /// </summary>
        public int agentid { get; set; }
        /// <summary>
        /// 服务商的应用名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 服务商的应用方形头像
        /// </summary>
        public string square_logo_url { get; set; }

        /// <summary>
        /// 授权人允许的权限(可以获取授权的用户、部门、标签)
        /// </summary>
        public privilege privilege { get; set; }

        /// <summary>
        /// 服务商套件中的对应应用id
        /// </summary>
        public int appid { get; set; }
    }

    /// <summary>
    /// 授权的权限
    /// </summary>
    public class privilege
    {
        /// <summary>
        /// 已授权的用户(可用来收发通知)
        /// </summary>
        public string[] allow_user { get; set; }

        /// <summary>
        /// 已授权的部门
        /// </summary>
        public string[] allow_party { get; set; }

        /// <summary>
        /// 已授权的标签
        /// </summary>
        public string[] allow_tag { get; set; }

        /// <summary>
        /// 权限等级。
        ///1:通讯录基本信息只读
        ///2:通讯录全部信息只读
        ///3:通讯录全部信息读写
        ///4:单个基本信息只读
        ///5:通讯录全部信息只写
        /// </summary>
        public int level { get; set; }
    }
}